﻿//
// PluginInterfaces.cs: Contains interfaces implemented by plugins.
//
// Copyright 2010 Michael Goethe
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//

// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace S9PalCommon
{
    /// <summary>
    /// Primary interface that a plugin must implement.
    /// </summary>
    public interface IPlugin
    {
        /// <summary>
        /// Gets the title of the plugin.
        /// </summary>
        string Name { get; }
        /// <summary>
        /// Gets a description of what the plugin does.
        /// </summary>
        string Description { get; }
        /// <summary>
        /// Gets the author of the plugin.
        /// </summary>
        string Author { get; }
        /// <summary>
        /// Gets the plugin's version.
        /// </summary>
        string Version { get; }

        /// <summary>
        /// Gets the controls that are to be added to the main form.
        /// </summary>
        List<IMainControl> MainControls { get; }
        /// <summary>
        /// Gets the controls that are to be added to the settings form.
        /// </summary>
        List<ISettingsControl> SettingsControls { get; }
        /// <summary>
        /// Gets the settings objects that are sent to the host application.
        /// </summary>
        List<Settings> Settings { get; }
        /// <summary>
        /// Gets the syncer objects that are sent to the host application.
        /// </summary>
        List<Syncer> Syncers { get; }
        /// <summary>
        /// Gets the worker objects that are sent to the host application.
        /// </summary>
        List<Worker> Workers { get; }

        /// <summary>
        /// Initializes the plugin and its components.
        /// </summary>
        void Initialize();
        /// <summary>
        /// Disposes the plugin and its components.
        /// </summary>
        void Dispose();
    }

    /// <summary>
    /// Interface for controls added to the main form.
    /// </summary>
    public interface IMainControl
    {
        string DisplayTitle { get; }
    }

    /// <summary>
    /// Interface for controls added to the settings form.
    /// </summary>
    public interface ISettingsControl
    {
        string DisplayTitle { get; }

        void ApplySettings();
        void UpdateControlValues();
    }
}
